/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package putime.model;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import putime.db.DBModel;

/**
 *
 * @author T420
 */
public class ModelLogin extends DBModel{
    public boolean checkLogin(String username,String password) throws SQLException
    {
      
            openConnect();
            prst=conn.prepareStatement("select * from tbl_users where Name=? and Password=?");
            prst.setString(1,username);
            prst.setString(2, password);
            rs=prst.executeQuery();
            if(rs.next())
            {
                closeConnect();
                return true;
            }
            
            else 
            {
                closeConnect();
                return false;
            }
           
        
        
    }
    
}
